public class Main {
    public static void main(String[] args) {
        int i=1;
        int sum=0;
        while(i<=5)
        {
            int j=1;
            int ret=1;
            while(j<=i)
            {
                ret*=j;
                j++;
            }
            sum+=ret;
            i++;
        }
        System.out.println(sum);
    }
}
